<?php
/**
 * Created by PhpStorm.
 * User: jz
 * Date: 16/7/7
 * Time: 下午1:57
 */

function db_connect()
{
    $conn = new mysqli('localhost', 'bm_user', 'password', 'bookmarks');
    if (!$conn){
        throw new Exception('不能链接到服务器');
    }
    return $conn;
}